home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / oleo-1_4.lha / oleo-1.4 / hash.h < prev    next >
C/C++ Source or Header  |  1993-01-01  |  2KB  |  64 lines

  1. /* hash.h - for hash.c
  2.    Copyright (C) 1987, 1992, 1993 Free Software Foundation, Inc.
  3.  
  4. This file is part of GAS, the GNU Assembler.
  5.  
  6. GAS is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. GAS is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GAS; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. #ifndef hashH
  21. #define hashH
  22.  
  23. /* define the type of bindings: */
  24. #undef  VOIDSTAR
  25. #define VOIDSTAR    char *
  26.  
  27. struct hash_entry
  28. {
  29.   char *hash_string;        /* points to where the symbol string is */
  30.   /* NULL means slot is not used */
  31.   /* DELETED means slot was deleted */
  32.   char *hash_value;        /* user's datum, associated with symbol */
  33. };
  34.  
  35.  
  36. #define HASH_STATLENGTH    (6)
  37. struct hash_control
  38. {
  39.   struct hash_entry *hash_where;/* address of hash table */
  40.   int hash_sizelog;        /* Log of ( hash_mask + 1 ) */
  41.   int hash_mask;        /* masks a hash into index into table */
  42.   int hash_full;        /* when hash_stat[STAT_USED] exceeds this, */
  43.   /* grow table */
  44.   struct hash_entry *hash_wall;    /* point just after last (usable) entry */
  45.   /* here we have some statistics */
  46.   int hash_stat[HASH_STATLENGTH];    /* lies & statistics */
  47.   /* we need STAT_USED & STAT_SIZE */
  48. };
  49.  
  50.  
  51. /*                        returns          */
  52. struct hash_control *hash_new ();    /* [control block]      */
  53. void hash_die ();
  54. void hash_say ();
  55. char *hash_delete ();        /* previous value         */
  56. char *hash_relpace ();        /* previous value         */
  57. char *hash_insert ();        /* error string           */
  58. char *hash_apply ();        /* 0 means OK             */
  59. VOIDSTAR hash_find ();        /* value                  */
  60. char *hash_jam ();        /* error text (internal)  */
  61. #endif /* #ifdef hashH */
  62.  
  63. /* end: hash.c */
  64.